<section class="content-header">
    <h1>修改管理员信息</h1>
</section>

<section class="content">
    <div class="box box-primary">
        <form class="form-horizontal" name="admins_edit_form" novalidate="novalidate" ng-submit="adminsEditForm()">
            <div class="box-body">
                <div class="form-group pt7" ng-class="{'has-success': admins_edit_form.name.$dirty && admins_edit_form.name.$valid && !admins_edit_form.name.$focused, 'has-error': admins_edit_form.name.$dirty && admins_edit_form.name.$invalid && !admins_edit_form.name.$focused}">
                    <label for="name" class="col-sm-2 control-label">管理员名字</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="name" name="name" ng-model="admin.name" placeholder="管理员名字" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': admins_edit_form.oldPassword.$dirty && admins_edit_form.oldPassword.$valid && !admins_edit_form.oldPassword.$focused, 'has-error': admins_edit_form.oldPassword.$dirty && admins_edit_form.oldPassword.$invalid && !admins_edit_form.oldPassword.$focused}">
                    <label for="oldPassword" class="col-sm-2 control-label">旧密码</label>
                    <div class="col-sm-9">
                        <input type="password" class="form-control" id="oldPassword" name="oldPassword" ng-model="admin.oldPassword" placeholder="请输入旧密码" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': admins_edit_form.newPassword.$dirty && admins_edit_form.newPassword.$valid && !admins_edit_form.newPassword.$focused, 'has-error': admins_edit_form.newPassword.$dirty && admins_edit_form.newPassword.$invalid && !admins_edit_form.newPassword.$focused}">
                    <label for="newPassword" class="col-sm-2 control-label">新密码</label>
                    <div class="col-sm-9">
                        <input type="password" class="form-control" id="newPassword" name="newPassword" ng-model="admin.newPassword" placeholder="请输入新密码" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': !admins_edit_form.password2.$pristine && admins_edit_form.password2.$valid, 'has-error': !admins_edit_form.password2.$pristine && admins_edit_form.password2.$invalid}">
                    <label for="password2" class="col-sm-2 control-label">确认新密码</label>
                    <div class="col-sm-9">
                        <input type="password" class="form-control" id="password2" name="password2" ng-model="admin.password2" placeholder="请再次输入新密码" ng-focus required pw-check="newPassword" />
                    </div>
                    <span class="col-sm-2"></span>
                    <span class="col-sm-9" ng-show="!admins_edit_form.password2.$pristine && admins_edit_form.password2.$invalid" style="color: #dd4b39;">两次输入的密码不一致</span>
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary pull-right" ng-disabled="admins_edit_form.$invalid">修改</button>
            </div>
        </form>
    </div>
</section>